home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / QuickTime / ChromaKeyMovie / Sources / eventloop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-20  |  1023 b   |  54 lines  |  [TEXT/MPS ]

  1. /****************************************************/
  2. /*                                                    */
  3. /*    File:    eventloop.c                                 */
  4. /*                                                     */
  5. /*    Program:    ChromaKeyMovie                        */
  6. /*                                                    */
  7. /*    By:        Jason Hodges-Harris                        */
  8. /*                                                    */
  9. /*    Copyright:    © 1995 by Apple Computer, Inc.,        */ 
  10. /*                    all rights reserved.            */        
  11. /*                                                    */
  12. /****************************************************/
  13.  
  14. // Mac toolbox headers
  15.  
  16. #ifndef __EVENTS__
  17. #include <Events.h>
  18. #endif
  19.  
  20.  
  21. // Program headers
  22.  
  23. #ifndef __CHROMAPPHEADER__
  24. #include "ChromaKeyMovie.app.h"
  25. #endif
  26.  
  27. #ifndef __CHROMAPROTOSHEADER__
  28. #include "ChromaKeyMovie.protos.h"
  29. #endif
  30.  
  31.  
  32. //    Global Variables
  33.  
  34. extern Boolean        gDone;                // program loop test condition
  35. extern Boolean        gMovieOpen;
  36.  
  37.  
  38. // EventLoop handles the application's main WNE loop
  39. // and is called from within the main() function.
  40.  
  41. #pragma segment Main
  42. void EventLoop (void)
  43. {
  44.     EventRecord    event;
  45.     
  46.     while (!gDone)
  47.     {
  48.         if (WaitNextEvent (everyEvent,&event,kSleep,nil) || gMovieOpen)
  49.         {
  50.             DoEvent (&event);
  51.         }
  52.     }
  53. }
  54.